﻿Public Class LogFile
    Dim Fs As IO.FileStream
    Dim Writer As IO.StreamWriter
    Private m_Path As String
    Public Sub New(ByVal Path As String)
        m_Path = Path
        Fs = New IO.FileStream(m_Path, IO.FileMode.Create)
        Writer = New IO.StreamWriter(Fs)
        Writer.WriteLine(My.Computer.Clock.LocalTime.ToLongTimeString & " : Start")
        Writer.Close()
    End Sub
    Public Sub Write(ByVal Txt As String)
        Fs = New IO.FileStream(m_Path, IO.FileMode.Append)
        Writer = New IO.StreamWriter(Fs)
        Writer.WriteLine(My.Computer.Clock.LocalTime.ToLongTimeString & " : " & Txt)
        Writer.Close()
    End Sub
    Public Sub Close()
        Fs = New IO.FileStream(m_Path, IO.FileMode.Append)
        Writer = New IO.StreamWriter(Fs)
        Writer.WriteLine(My.Computer.Clock.LocalTime.ToLongTimeString & " : Shutdown")
        Writer.Close()
    End Sub
End Class
